package oving6;

public class SavingsAccount implements Account {

	private int balance;
	private final int credit;
	public SavingsAccount(){
		balance=0;
		credit=0;
	}
	public int deposit(int newDepo) {
		if(!(newDepo<0)){
			balance+=newDepo;
		}
		return balance;
	}

	
	public int getBalance() {
		return balance;
	}

	public int getCredit() {
		return credit;
	}

	public int withdraw(int newWithd) {
		if(balance>=newWithd&&!(newWithd<0)){
			 balance-=newWithd;
			 return newWithd;
		}
		return 0;
		
	}

}
